using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_gal_phoneMap : EntityTypeConfiguration<so_gal_phone>
    {
        public so_gal_phoneMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.SectionString)
                .HasMaxLength(500);

            this.Property(t => t.SECTION_LABEL)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.CITY_CODE)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.LOCATION_TYPE)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.FREEFORM_PHONE_DATA)
                .IsFixedLength()
                .HasMaxLength(8);

            // Table & Column Mappings
            this.ToTable("so_gal_phone");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.reference).HasColumnName("reference");
            this.Property(t => t.SectionString).HasColumnName("SectionString");
            this.Property(t => t.SECTION_LABEL).HasColumnName("SECTION LABEL");
            this.Property(t => t.CITY_CODE).HasColumnName("CITY CODE");
            this.Property(t => t.LOCATION_TYPE).HasColumnName("LOCATION TYPE");
            this.Property(t => t.FREEFORM_PHONE_DATA).HasColumnName("FREEFORM PHONE DATA");
        }
    }
}
